package com.stars.empoly.vmodel

import android.app.Application
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.stars.empoly.model.CouponsBean
import com.stars.empoly.utils.net.NetEngine
import com.trailer.base.base.BRepository
import com.trailer.base.base.BViewModel
import kotlinx.coroutines.launch

class CouponVModel(application: Application) : BViewModel<BRepository>(application) {


    var list=MutableLiveData<List<CouponsBean>>()

    fun getInfo(){
        viewModelScope.launch {
            var it=repository().lreq { NetEngine.service.coupons() }
            if(it.ok()){
                list.value=it.data
            }
        }
    }



}



